home *** CD-ROM | disk | FTP | other *** search
- _ __ __ _____ __ __
- | | / /__ / /_ / ___// /___ __/ /__
- | | /| / / _ \/ __ \\__ \/ __/ / / / / _ \
- | |/ |/ / __/ /_/ /__/ / /_/ /_/ / / __/
- |__/|__/\___/_.___/____/\__/\__, /_/\___/
- /____/
-
-
-
- (c) Robin Moffatt (R.Moffatt@IName.com) V1.29 (Thu 05th February 1998)
-
- See http://www.moffatt.demon.co.uk/me/webstyle.html for more information
-
- Introducing WebStyle
- --------------------
- With all this talk about Stylesheets etc in the next version of HTML, I
- thought I'd write something which provided a cheap imitation of it, which
- would be available now, not whenever the HTML spec comes out plus a year for
- Acorn browsers to catch up......
-
- You can use WebStyle (referred to as WS) as much or as little in your
- documents. You can have a simple header and footer for every page, or have
- many different tags on one page.
-
- The big advantage of using Tags, rather than cutting and pasting a Header or
- Footer every time is that you can update a single source file, and leave
- WS to update the right parts of all your HTML pages.
-
- My practical use, and motivation, for writing WS, is a set of HTML
- pages, comprising the Horn Resources Pages (http://bounce.to/horn/). These
- pages collect together over 190 separate topics from a mailing list, about
- horn playing. I used to have to use crude search&replace routines, or even
- do it by hand, when I wanted to change all the headers and footers on the
- pages, for example to update an email address. Now I just change the
- Stylefile and leave WS to do it all for me :)
-
-
- WS works on a system of Tags (embedded within HTML comments), and
- Styles. Each Style has its own file, within the directory
- <WebStyle$Dir>.styles The name of the file in the styles directory is the name
- of the Style.
-
- As of version 0.20 of WS, you can mix Styles within a single HTML
- document. This means, for example, that you could have a generic footer for
- every single page on your site, but different headers depending on whether the
- page is in the, say, Weatherwax or Beeblebrox section of your site.
-
- WS currently runs in 128k of memory. It's been written on and tested
- on a RPC600, and a can't see why it won't run on a SA, but then again that's
- not really much of an assurance :) It might work on RO2 - if you are still
- using it then mail me, just so I can have a good laugh. Seriously, I'd be
- interested to know if it does still work, and if it's a simple thing
- preventing it from working may even feel moved to fix it.
-
- WS requires WimpExtension to run. ATM WS is only happy with
- WimpExt 2.18, which is why I've (as of WS1.14) decided to distribute it with
- WS. If anyone can point me towards documentation for WimpExt 3.45 then I'll
- set about making WS compatible with it.
-
- At the moment WS is written in 100% pure, un-compacted, un-optimised
- BASIC. This is because I don't have a C compiler (boo-hoo. Not. Since I
- don't know any C either:), and I have better things to do with my time than
- arse around with ARM code. I'll have to be careful what I write here, after
- what happened with the frontend, but if anyone wants to convert main
- processing bits into something fast then they are more than welcome to. Mail
- me first to check it's not been done already :)
-
-
- Using WS
- --------------
- Before running WS, you have to do two things:
-
- 1) Construct your style files. You can have just one, or you can have
- twenty. It depends on how much versatility you require. Note that at the
- moment the maximum number of tags that WS will handle is 50. If you
- need more than this then alter the line maxstyle%=50 to whatever is
- required. I plan to make this more easily configurable in the near future.
-
- Each Style should be in a separate file in the directory
- <WebStyle$Dir>.styles - the filename gives the name of the Style.
-
- The syntax for Style files is the Tag name enclose by ASCII
- character 235 (ë), then the HTML code to insert, starting on a newline,
- then an ASCII character 233 (é) to mark the end of the HTML to insert.
-
- For example:
-
- ëTagNameë
- <H1>This bit to insert</H1>
- <EM>and this</EM>
- <STRONG>and this as well</STRONG>
- é
-
- In this case, you would have a Tag called TagName which when inserted in
- the HTML would give
-
- <H1>This bit to insert</H1>
- <EM>and this</EM>
- <STRONG>and this as well</STRONG>
-
- The order that each separate Tag comes is not important. Please note that
- Tag names /ARE/ case sensitive!
-
- Dynamic Variables
- -----------------
- There are currently four dynamic tags available. These are codes placed
- in the Style file which are then processed at run-time. They are:
-
- ASC 232 è Current Date
- ASC 231 ç URL of page
- ASC 230 æ Local filename of page (inc. path)
- ASC 229 å Filename of file being processed (exc. path)
-
- A suggested use for these is to place the following lines in the Stylefile (within a tag name, for example Footer)
-
- ëFooterë
- <HR>
- Last updated: è<BR>
- URL: ç <BR>
- Local path: æ<BR>
- Local filename: å
- é
-
- When processed by WS would give something like:
- Last updated: Sat, 06 Dec 1997
- URL: http://www.hostname.demon.co.uk/file.htm
- Local path: ADFS::Harddisc4.$.Netpages.file/htm
- Local filename: file/htm
-
-
- 2) Insert your tags into the HTML files. This only needs to be done once,
- since WS retains the Tags when processing the file, so you can
- re-process the HTML files again and again, without having to insert the tags
- each time.
-
- Say you want to insert the tag from the style file above. If we are
- working from just one style file, then the Tag syntax would be:
-
- <!--WS=TagName-->
- <!--endWS-->
-
- which when processed would give
-
- <!--WS=TagName-->
- <H1>This bit to insert</H1>
- <EM>and this</EM>
- <STRONG>and this as well</STRONG>
- <!--endWS-->
-
- However, if we want to specify from which Style to use the tag, the
- syntax is:
-
- <!--WS=TagName{default}-->
- <!--endWS-->
-
- This would then look for the Tag "TagName" in the Style "default"
-
- If there is a tag in an HTML file without a matching style entry, a note
- will be put in the resulting HTML file, as well as an error being displayed
- on screen. The program will still continue to run, meaning that one duff
- entry won't stop the rest of the file being processed
-
- As of WS 1.20 you can have 'interactive' (thank god for Buzzwords;) tags.
- This means that each document can have, say, a title added to it when it's
- being processed.
-
- To do this, you use tags as detailed above, but use the ASCII character
- 236 (ì). For example
-
- <!--WS=ìPageTitle-->
- <!--endWS-->
-
- would make WS prompt you for "PageTitle" when it gets to that tag.
- As well as simply entering the text into the icon, you can have up to 20
- predefined responses. These are defined in the file <WebStyle$Dir>.insert
-
- The format of this file is
-
- <menu label>,<text to insert>
-
- The <menu label> must be no longer than 12 character, otherwise it all
- goes pear shaped. The text to insert, I think, can be up to 255
- characters.
-
- Make sure that you end the file with a newline.
-
-
- The Configuration file
- ----------------------
- As of 1.18 there are now 4 configuration options. Two of these can be set
- from the main window, but for the moment you have to enter the other two
- manually. (The templates and code are actually in the application to allow
- one to enter the data without editting the file, but I'm buggered if I can
- get it to work....anyone is welcome to try :)
-
- + To do this, open up the !WS directory (Hold down Shift and double
- click on !WS)
- + Double-click on the directory "User"
- + Double-click on the file "config"
- + After "Root directory on local disc for webpages = " enter the root
- directory. For example, if all your pages are stored in directories
- leading off from ADFS::HardDisc4.$.Internet.WebPages this would be your root
- directory. I use raFS, so my root directory is raFS::WebSite.$ Note that you
- _don't_ need a trailing dot, and if you do put one in WS will get upset.
- + After "Root directory on remote server = " enter the root directory for
- your remote server, where your web pages are kept. For demon users this will
- probably be http://www.<nodename>.demon.co.uk/
- + Make sure there is always a space /after/ the = sign, on both lines,
- otherwise, again, WS will get upset
-
- Running WS
- ----------------
- NB. It's advisable to unpack WS from the archive before running it
-
- Double-click on !WS to run it. Clicking on the icon-bar WS icon
- will open the main window, from where you can choose how you wish to process
- the files. If you use automatic tagging (see above) or Clear tags, you just
- select the option, load your files (see below), and click on Start
- Processing. If you use a specific Style file you have to select one from the
- menu to the right of the icon. This will list all of the style files found
- in the directory <WebStyle$Dir>.styles
-
- Note that when processing using a specific Style file, WS will insert
- this stylefile name into Automatic-tagging tags, so that next time you
- process the file you can just use Automatic tagging. If this proves
- unhelpful, let me know and I'll make it optional
-
-
- As of v1.00 of WS there are three ways of getting WS to process
- an HTML file.
-
- + Any filelist text files that people used with earlier versions
- are still valid. These are files with the _full_ filename of each HTML
- file in, separated by a newline (ASC10 or ASC13). Make sure there is a
- newline after the last file item. Drop this resulting text file onto the
- WS icon and off you go :)
- + Drop a single, or a batch, of HTML files onto the WS icon (or
- window)
- + Drop a directory or X-File onto the WS icon (or window). The
- directory or X-File will be searched for all HTML files. WS won't
- recursively search the directory/X-File, ie. it will only find HTML in the
- first level of the directory/X-File
-
- You can combine all three of these methods at once - the files are simply
- added onto the end of the queue.
-
- WS will attempt to process every file you feed it - no problem if it's
- just an HTML file without any tags, since it'll just ignore it, but it will
- most likely barf if you give it JPEGs etc
-
-
- Misc
- ----
- A log file is kept at <WebStyle$Dir>.error
- At the moment there is no way to disable it, but if it's needed let me know
- and I'll add the option. Actually, I tell a lie - you can set log% to FALSE
- in PROCInit, but this isn't advised, since PROCLog is used for more than
- writing to the log file, and may cause problems if it is disabled, tho' it
- shouldn't really
-
- This program does what I envisaged, and only that. If you want it to do
- something, then ask me nicely, and I'll try to add it. Alternatively, if
- you're feeling brave, you could try and make sense of my programming, and do
- it yourself. If you do change something, let me have a copy!
-
-
- Legal bits
- ----------
- + You are advised to work solely from backups. WS /shouldn't/ chew up
- your HTML files or feed them to the dog, but if it does, it ain't my fault!
- By using this program you accept responsibility for all use of WS, and
- any problems which may be inherent through that.
- + WS inserts a single line to indicate when the page was last
- processed, as well as a little credit for the program. I would appreciate
- if you'd leave the line in, seeing as I'm not charging for the program. If
- it bothers you that much then donate 5 UKP to Imperial Cancer Research and
- I'll send you a copy of the program with the credit etc removed. Of
- course, you could do it yourself by hand (ooo-er;) but that's hardly a
- nice thing to do is it?
- + This is <insert witty-ware name here>
- + I retain all copyright on the code etc, but feel free to copy it, hand it
- around, feed it to your dog etc.
- + If you do nick bits of the code (though it really isn't worth it, believe
- me:), I'd appreciate a credit for it
- + For PD distribution, please notify me first. The exception to this is
- Skyfall PD, who are forbidden to distribute this program
- + For magazine distribution (I wish:) please contact me.
- + I would appreciate a quick email if you do use this, just to let me know
- *someone* is using it!
-
-
- History
- -------
- 0.11 (29 Sep 97) First release
- 0.20 (21 Oct 97) Added multiple styles per document
- Added process directory, doing away with the hassle
- of the 'files' file
- Improved appearance of the 'front-end'
- Altered log file, added 'Fatal' and 'Processing'
- errors
- 1.00 (23 Oct 97) Created multitasking frontend - no need for
- Taskwindows any more
- Removed bug causing filelist files with ASC13 instead
- of ASC10 as linefeeds to not work
- 1.05 (29 Oct 97) Added selection of Styles from a menu
- Found and [hopefully] fixed loads of likkle bugs.
- 1.10 (31 Oct 97) Corrected stupid error causing WS not to run
- if it can't find WimpExt in the !WS directory
- Corrected the WS URL that's added to every
- HTML page that is processed
- Added Configuration file
- Added Singletasking
- 1.14 (07 Nov 97) Removed WS sprite to cut down archive size
- Re-done Template file to correct error with large
- desktop fonts obscuring option buttons
- Added check for Style files that have been altered
- while WS is running
- Added check for duplicate files
- Added WimpExt 2.18 to distribution archive
- 1.15 (12 Nov 97) Added definable file limit
- Added 'Open style dir' button (Thanks to Phil Williams for these two)
- Couple of logging alterations
- Fixed problem with verifying the length of style
- files when doing "Clear out tag contents"
- 1.15a (16 Nov 97) Fixed directory handling bug
- 1.15b (16 Nov 97) Fixed fix for directory handling bug (!!)
- 1.16 (18 Nov 97) Corrected iconbar menu height
- 1.20 (19 Nov 97) Added Dynamic URL and Local filename insertion
- Added tags allowing text to be entered during processing
- Restructured the WS directory in anticipation of
- future expansion
- 1.21 (20 Nov 97) Fixed bug where <!--endWS--> would sometimes be duplicated
- 1.25ß (03 Dec 97) Added Dynamic Processing
- 1.26 (09 Dec 97) Removed Dynamic Processing!
- Added 'Open logfile' to Iconbar menu
- 1.27 (12 Jan 98) Hopefully some kind of final release, for now anyway!
- 1.28 (03 Feb 98) Final release? Don't be daft! Tidied up templates etc
-
-
- Future
- ------
- + WS gets really upset if you try and save files into it directly
- from other programs, eg. an HTML file straight from an editor, or a text
- filelist. It shouldn't be too hard (I hope:) to make it just ignore
- these. Even better can someone tell be simply how to handle the files
- myself?
- + WS Crashes if you add a style file and don't restart WS before trying to
- process a file. Since it's a not very common thing to do, and doesn't
- cause loss of data, I can't be bothered to fix it now :-)
- + Would be nice to be able to have the local and remote directories set
- somewhere within the HTML file being processed, rather than being hardwired
- into the configuration. This way files uploaded on seperate servers, or
- running from different file systems can be processed without having to
- re-configure WS each time.
- + Save to box for HTML file once processed
- + Window containing tags for auto-insertion into an editor window
- + Any other suggestions? Mail me! (See below for address)
-
-
- Bugs
- ----
- Any deviations from the progam's normal functions are simply an alternative
- way of doings things to what was envisaged by the author, and if you can't
- accept that then I really think you need to take a long look at your
- attitudes and acceptance of other views.
-
- Seriously tho, I've not really found /proper/ bugs - doing daft stuff like
- running it without any input files is liable to upset it, but then again
- it's a rather dumb thing to do. Still, I'd like to know about any little
- discrepancies you find, since my aim is to create a program that is very
- easy, and very bug-free, to use :)
-
-
- Thanks To
- ---------
- Me, for writing it ;-)
- Philip Powell, for suggesting a !WS.process directory plus masses of other
- general feedback and support.
- Stephen Read, for pointing out that WS was only recognizing LFs in the
- 'files' file instead of CRs, which StrongEd inserts.
- Dominic Symes, for Zap
- Tim Tyler, for Zap's HoTMeaL mode
- Jon Ribbers, for Wimp Extension
- Ferdinand Veldmans, for writing a frontend as I requested in the v0.11
- helpfile, only to find I'd decided to try and write one
- anyway. Sorry again for wasting your time :-)
- Also for sending me the calculation regarding the
- correct height for the iconbar menu.
- Phil Williams (aka RottenSod), for sending me the additional code to make the file limit
- definable, and for the 'open style dir' button bit
-
-
- Obtaining the latest version of WS
- ----------------------------------------
- http://www.moffatt.demon.co.uk/me/webstyle.html
- Or various FTP sites included HENSA, Demon and Argonet, when I get round to
- uploading it there.
-
- Contacting me
- -------------
- Email: Take your pick <g> (all should work, but are given in order of
- preference, top to bottom)
-
- R.Moffatt@IName.com
- Robin@moffatt.demon.co.uk
-
- WWW:
- http://bounce.to/Robin/
- http://www.moffatt.demon.co.uk/
-
-
- --
- |D |\/| ** http://bounce.to/Robin/ ** Sheffield, UK **
- |\obin | |offatt ** R.Moffatt@IName.com ** Horn Player **
-
- "...except a few pieces most of this more or less organised noise
- sounds to me like the noise someone's body might produce after
- eating cherries & cucumbers & drinking a lot of water afterwards.
- What the body produces after this 'special diet' (you could
- replace water with 'new wine') by shock and releases by shock,
- just this sounds & smells like a lot of the products by these
- chaotic self established composers."
-
- - Prof Hans Pizka on much of Modern music
-
- Horn Resources Pages - http://bounce.to/horn/
-